package com.ruoyi.project.lely.bean.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

/**
 * 分组讨论规则
 *
 * @author luoyong
 */
@Data
@ApiModel("分组讨论规则 入参DTO")
public class LyGrouponRulesDTO {

    @ApiModelProperty("ID")
    private Long id;

    @NotNull
    @ApiModelProperty("商品表的商品ID")
    private Long goodsId;

    @Length(max = 127, message = "商品名称长度不能超过127位")
    @NotEmpty
    @ApiModelProperty("商品名称")
    private String goodsName;

    @Length(max = 255, message = "商品图片或者商品货品图片长度不能超过255位")
    @ApiModelProperty("商品图片或者商品货品图片")
    private String picUrl;

    @Digits(integer = 63 - 0, fraction = 0)
    @NotNull
    @ApiModelProperty("优惠金额")
    private BigDecimal discount;

    @NotNull
    @ApiModelProperty("达到优惠条件的人数")
    private Integer discountMember;

    @ApiModelProperty("团购过期时间")
    private LocalDateTime expireTime;

}
